import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
   {
    title: '旧设备编号',
    align:"center",
    dataIndex: 'oldDeviceNo'
   },
   {
    title: '旧设备名称',
    align:"center",
    dataIndex: 'oldDeviceName'
   },
   {
    title: '新设备编号',
    align:"center",
    dataIndex: 'newDeviceNo'
   },
   {
    title: '新设备名称',
    align:"center",
    dataIndex: 'newDeviceName'
   },
   {
    title: '所属终端',
    align:"center",
    dataIndex: 'terminalId'
   },
   {
    title: '所属接头',
    align:"center",
    dataIndex: 'cableJointId'
   },
   {
    title: '被更换设备',
    align:"center",
    dataIndex: 'replaceDeviceId'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
     {
      label: "更新日期",
      field: "updateTime",
      component: 'RangePicker',
      componentProps: {
          valueType: 'Date',
          showTime:true
      },
      //colProps: {span: 6},
	},
	{
      label: "旧设备编号",
      field: 'oldDeviceNo',
      component: 'Input',
      //colProps: {span: 6},
 	},
	{
      label: "新设备编号",
      field: 'newDeviceNo',
      component: 'Input',
      //colProps: {span: 6},
 	},
	{
      label: "所属终端",
      field: 'terminalId',
      component: 'Input',
      //colProps: {span: 6},
 	},
	{
      label: "所属接头",
      field: 'cableJointId',
      component: 'Input',
      //colProps: {span: 6},
 	},
];
//表单数据
export const formSchema: FormSchema[] = [
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];

// 高级查询数据
export const superQuerySchema = {
  createBy: {title: '创建人',order: 0,view: 'text', type: 'string',},
  updateTime: {title: '更新日期',order: 1,view: 'datetime', type: 'string',},
  oldDeviceNo: {title: '旧设备编号',order: 2,view: 'text', type: 'string',},
  oldDeviceName: {title: '旧设备名称',order: 3,view: 'text', type: 'string',},
  newDeviceNo: {title: '新设备编号',order: 4,view: 'text', type: 'string',},
  newDeviceName: {title: '新设备名称',order: 5,view: 'text', type: 'string',},
  terminalId: {title: '所属终端',order: 6,view: 'text', type: 'string',},
  cableJointId: {title: '所属接头',order: 7,view: 'text', type: 'string',},
  replaceDeviceId: {title: '被更换设备',order: 8,view: 'text', type: 'string',},
};

/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}
